package org.jackysoft.struts2.business;
import java.util.Collection;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Namespace;
import org.jackysoft.entity.ForwardStore;
import org.jackysoft.service.ForwardStoreService;
import org.jackysoft.struts2.UtilsCRUDAction;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;



@Namespace("/forwardstore")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class ForwardStoreAction extends UtilsCRUDAction<ForwardStore> {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4035645340762205346L;
	private ForwardStoreService service;
	private ForwardStore bean;
	private Collection<ForwardStore> beans;	
	
	
	public String fromExcel() throws Exception{
		service.importForwardStore(upLoad, usedate.getYear(),usedate.getMonthOfYear());
       	return "fromExcel";
	}
	
	
	
	
	public void setBean(ForwardStore bean){
	     this.bean = bean;
	}
	public ForwardStore getBean(){
	     return this.bean;
	}
	public void setBeans(Collection<ForwardStore> beans){
	
	     this.beans = beans;
	}
	public Collection<ForwardStore> getBeans(){
	     return this.beans;
	}
	
	@Resource
	public void setService(ForwardStoreService service) {
		this.service = service;
		this.setDataProvider(service);
	}	
	
	public ForwardStoreService getService(){
	   return this.service;
	}
		
}